package pro;

import java.util.HashMap;
import java.util.Map;

public class PrototypeRegistry {
    private static Map<String, PrototypeFruit> prototypes = new HashMap<>();

    public static void registerPrototype(String key, PrototypeFruit fruit) {
        prototypes.put(key, fruit);
    }

    public static PrototypeFruit getPrototype(String key) {
        PrototypeFruit prototype = prototypes.get(key);
        return prototype != null ? prototype.clone() : null;
    }
}